//
//  UserProfile.swift
//  letusmeet_ios
//
//  Created by Rovo Dev on 2025/1/27.
//

import Foundation
import SwiftData

@Model
final class UserProfile {
    var id: String
    var username: String
    var userID: String
    var level: String
    var avatar: String
    var createdActivities: Int
    var joinedActivities: Int
    var friendsCount: Int
    var tags: [String]
    var nickname: String
    var gender: String
    var age: Int
    var city: String
    var profession: String
    var timestamp: Date
    
    init(
        id: String = UUID().uuidString,
        username: String,
        userID: String,
        level: String = "🌟 社交达人",
        avatar: String = "👤",
        createdActivities: Int = 0,
        joinedActivities: Int = 0,
        friendsCount: Int = 0,
        tags: [String] = [],
        nickname: String = "",
        gender: String = "",
        age: Int = 0,
        city: String = "",
        profession: String = "",
        timestamp: Date = Date()
    ) {
        self.id = id
        self.username = username
        self.userID = userID
        self.level = level
        self.avatar = avatar
        self.createdActivities = createdActivities
        self.joinedActivities = joinedActivities
        self.friendsCount = friendsCount
        self.tags = tags
        self.nickname = nickname
        self.gender = gender
        self.age = age
        self.city = city
        self.profession = profession
        self.timestamp = timestamp
    }
}

// 活动数据模型
@Model
final class Activity {
    var id: String
    var title: String
    var location: String
    var coverImage: String
    var timestamp: Date
    
    init(
        id: String = UUID().uuidString,
        title: String,
        location: String,
        coverImage: String,
        timestamp: Date = Date()
    ) {
        self.id = id
        self.title = title
        self.location = location
        self.coverImage = coverImage
        self.timestamp = timestamp
    }
}